public class PolymorphismExample {
    public static void main(String[]args){
        Animal myDog = new Dog();
        Animal myCat = new Cat();
        myDog.makeSound();
        myCat.makeSound();
        Animal[]animals ={new Dog(),new Cat(),new Animal()};
        for (Animal animal:animals){
            animal.makeSound();
        }
    }
}
